#include "CSetSizeCommand.h"
#include "CUserInterface.h"
#include "CLevelEditor.h"
#include "IBillboardSceneNode.h"
#include "ISceneManager.h"
//#include "ISceneNode.h"

extern CGlobals* g;
extern CUserInterface* ui;
extern CLevelEditor* editor;

CSetSizeCommand::CSetSizeCommand (int id, dimension2d<f32> oldSize, dimension2d<f32> newSize)
{
	m_id = id;
	m_oldSize = oldSize;
	m_newSize = newSize;
	setDescription(L"change size");
}

void CSetSizeCommand::redo ()
{
	(dynamic_cast<IBillboardSceneNode*>(g->sceneManager->getSceneNodeFromId(m_id)))->setSize(m_newSize);
}

void CSetSizeCommand::undo ()
{
	(dynamic_cast<IBillboardSceneNode*>(g->sceneManager->getSceneNodeFromId(m_id)))->setSize(m_oldSize);
}
